package com.atguigu.test3;

import org.junit.Test;

import java.lang.reflect.InvocationTargetException;

/**
 * @author 路飞
 * @date 2024/4/5 14:17
 * @description
 */
public class Test01 {

    @Test
    public void testClass() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Class<?> aClass = ClassLoader.getSystemClassLoader().loadClass("java.lang.String");
        Object aaa = aClass.getDeclaredConstructor(String.class).newInstance("hello world");
        System.out.println("aaa = " + aaa);
    }
}
